package ai.esc.speedy.common.base;

import ai.esc.speedy.common.util.id.UIDGenerator;
import org.axonframework.commandhandling.gateway.CommandGateway;
import org.axonframework.common.jpa.EntityManagerProvider;
import org.axonframework.queryhandling.QueryGateway;

import javax.annotation.Resource;
import javax.persistence.EntityManager;

/**
 * @author Rubin
 * @version v1 2020/3/3 17:58
 */
public class BaseController {

    @Resource
    protected UIDGenerator uidGenerator;

    @Resource
    protected CommandGateway commandGateway;

    @Resource
    protected QueryGateway queryGateway;

    @Resource
    protected EntityManagerProvider entityManagerProvider;

    public EntityManager getEntityManager() {
        return entityManagerProvider.getEntityManager();
    }

}
